#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n) {
    int k = 0;
    int a[200] = { 0 };
    int i = 0, j = 0;
    while (m && n)
    {
        if (nums1[i] >= nums2[j])
        {
            a[k++] = nums2[j];
            j++;
            n--;
        }
        else
        {
            a[k++] = nums1[i];
            i++;
            m--;
        }
    }
    while (m)
    {
        a[k++] = nums1[i];
        i++;
        m--;
    }
    while (n)
    {
        a[k++] = nums2[j];
        j++;
        n--;
    }
    for (int i = 0; i < k; i++)
    {
        nums1[i] = a[i];
    }
}
int main()
{
    int num1[6] = { 1,2,3,0,0,0 };
    int num2[3] = { 2,5,6 };
    int m = 3, n = 3;
    merge(num1, 6, m, num2, 3, n);

    return 0;
}